Uec3.ChooseCompanyCertifyWindow = Ext.extend(Ext.app.Module, {
	id : 'chooseCompanyCertify',
	type : 'common/chooseCompanyCertify',

	/**
	 * Initialize this module. This function is called at startup (page
	 * load/refresh).
	 */
	init : function(initParams) {
	},

	getComponents : function(params) {

		var chooseCompanyCertifyForm;
		var isVisblePanel;
		var id;
		var middlePanel;
		var businessLicenseFile1;
		var taxCertificationFile;
        var chooseCompanyCertify_dist_cmb;
        var chooseCompanyCertify_city_cmb;
        var chooseCompanyCertify_prov_cmb;
		var componentChooseCompanyCertifyInits = function() {

			// 区县下拉框
			chooseCompanyCertify_dist_cmb = getDistrictCombox(Uec3.App.Constants.homeUrl);
			chooseCompanyCertify_dist_cmb.setWidth(200);
			chooseCompanyCertify_dist_cmb.allowBlank=false;
			// 城市下拉框
			chooseCompanyCertify_city_cmb = getCityCombox(Uec3.App.Constants.homeUrl,
					chooseCompanyCertify_dist_cmb);
			chooseCompanyCertify_city_cmb.setWidth(200);
			chooseCompanyCertify_city_cmb.allowBlank=false;
			// 省份下拉框
			chooseCompanyCertify_prov_cmb = getProvinceCombox(Uec3.App.Constants.homeUrl,
					chooseCompanyCertify_city_cmb, chooseCompanyCertify_dist_cmb);
			chooseCompanyCertify_prov_cmb.setWidth(200);
			chooseCompanyCertify_prov_cmb.allowBlank=false;
			
			function choosePicture(name, v, check) {

				if (check) {

					Ext.Msg.confirm('提示', '已上传图片,是否重新上传', function(btn) {
								if (btn == 'yes') {

									if (Ext.util.Format.lowercase(v)
											.lastIndexOf(".jpg") != -1
											|| Ext.util.Format.lowercase(v)
													.lastIndexOf(".gif") != -1
											|| Ext.util.Format.lowercase(v)
													.lastIndexOf(".png") != -1) {
									} else {
										Ext.Msg.alert("错误", "请选择正确的图片文件");
										chooseCompanyCertifyForm.getForm()
												.findField(name).reset();
									}

								} else {

									chooseCompanyCertifyForm.getForm()
											.findField(name).reset();
								}

							})

				} else {

					if (Ext.util.Format.lowercase(v).lastIndexOf(".jpg") != -1
							|| Ext.util.Format.lowercase(v).lastIndexOf(".gif") != -1
							|| Ext.util.Format.lowercase(v).lastIndexOf(".png") != -1) {
					} else {
						Ext.Msg.alert("错误", "请选择正确的图片文件");
						chooseCompanyCertifyForm.getForm().findField(name)
								.reset();
					}

				}

			}

			businessLicenseFile1 = new Ext.form.FileUploadField({

				emptyText : '请选择营业执照副本复印件...',
				style : "margin-left:6px",
				height : 30,
				width : 320,
				name : 'businessLicenseFile',
				buttonText : '',
				allowBlank : false,
				blankText : "营业执照副本复印件不允许为空",
				buttonCfg : {
					iconCls : 'icon-photo'
				},

				listeners : {
					'fileselected' : function(fb, v) {
						var rootElement = chooseCompanyCertifyForm.getForm().reader.jsonData.root;

						choosePicture('businessLicenseFile', v,
								rootElement.businessLicensePath);

					}
				}
			});

			taxCertificationFile = new Ext.form.FileUploadField({

				emptyText : '请选择税务登记证副本复印件...',
				style : "margin-left:6px",
				height : 30,
				width : 320,
				allowBlank : false,
				blankText : "税务登记证副本复印件不允许为空",
				name : 'taxCertificationFile',
				buttonText : '',
				buttonCfg : {
					iconCls : 'icon-photo'
				},

				listeners : {
					'fileselected' : function(fb, v) {
						var rootElement = chooseCompanyCertifyForm.getForm().reader.jsonData.root;
						choosePicture('taxCertificationFile', v,
								rootElement.taxCertificationPath);

					}
				}
			});

			var formReader = new Ext.data.JsonReader(

			{
						root : 'root'
					}, [{
								name : 'id',
								type : 'int'
							},{
								name : 'areaId',
								type : 'int'
							}, {
								name : 'name',
								type : 'string'
							}, {
								name : 'contactor',
								type : 'string'
							}, {
								name : 'contactorIdentityCode',
								type : 'string'
							}, {
								name : 'contactorIdPath',
								type : 'string'
							}, {
								name : 'businessLicensePath',
								type : 'string'
							}, {
								name : 'taxCertificationPath',
								type : 'string'
							}, {
								name : 'code',
								type : 'string'
							}, {
								name : 'realType',
								type : 'int'
							}, {
								name : 'companyType',
								type : 'int'
							}, {
								name : 'requestRealType',
								type : 'int'
							}, {
								name : 'requestCompanyType',
								type : 'int'
							}, {
								name : 'business',
								type : 'string'
							}, {
								name : 'taxCode',
								type : 'string'
							}, {
								name : 'isCertifying',
								type : 'int'
							}]

			);

			isVisblePanel = new Ext.Panel({

				layout : 'form',
				defaults : {
					anchor : '100%',
					msgTarget : 'side'
				},

				items : [{
							xtype : 'panel',
							style : "margin-top:6px;",
							defaultType : 'textfield',
							anchor : '100%',
							layout : 'column',
							border : false,
							items : [{
										xtype : 'label',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:47px;",
										text : '工商注册号:'

									}, {

										name : 'code',
										width : 200,
										style : "margin-left:6px",
										allowBlank : false,
										blankText : '工商注册号必须填写'
									},

									{
										xtype : 'label',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:15px;",
										text : '营业执照副本复印件:'

									}, businessLicenseFile1]
						},

						{
							xtype : 'panel',
							style : "margin-top:6px;",
							defaultType : 'textfield',
							layout : 'column',
							border : false,
							items : [{
										xtype : 'label',
										text : '税号:',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:47px;"
									}, {

										name : 'taxCode',
										width : 200,
										style : "margin-left:6px",
										allowBlank : false,
										blankText : '税号必须填写'
									}, {
										xtype : 'label',
										text : '税务登记证副本复印件:',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:15px"
									}, taxCertificationFile]
						}]
			});

			middlePanel = new Ext.Panel({

				frame : true,
				layout : 'form',
				defaults : {
					msgTarget : 'side'
				},
				items : [{
							xtype : 'panel',
							defaultType : 'textfield',
							style : "margin-top:6px;",
							layout : 'column',
							border : false,
							items : [{
										xtype : 'label',
										text : '公司名称:',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:47px;"
									}, {

										name : 'name',
										width : 300,
										style : "margin-left:6px",
										allowBlank : false
									}, {
										xtype : 'label',
										text : '法人名称:',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:15px"
									}, {

										name : 'contactor',
										width : 300,
										style : "margin-left:8px",
										allowBlank : false
									}]
						},
						{   
							xtype:'panel',
							defaultType : 'textfield',
							style : "margin-top:6px;",
							layout : 'column',
							border : false,
							items : [{
										xtype : 'label',
										text : '省份:',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:47px;"
									}, 
									chooseCompanyCertify_prov_cmb,
									{
										xtype : 'label',
										text : '城市:',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:15px"
									},chooseCompanyCertify_city_cmb,{
										xtype : 'label',
										text : '区县:',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:15px"
									},chooseCompanyCertify_dist_cmb]
						},
						{
							xtype : 'panel',
							defaultType : 'textfield',
							style : "margin-top:6px;",
							anchor : '100%',
							layout : 'column',
							border : false,
							items : [{
										xtype : 'label',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:47px;",
										text : '法人身份证:'

									}, {
										name : 'contactorIdentityCode',
										allowBlank : false,
										fieldLabel : "法人身份证",
										blankText : '请填写身份证号',
										width : 200,
										style : "margin-left:6px",
										regex : /(^\d{15}$)|(^\d{17}([0-9]|X|x)$)/,
										regexText : '输入的身份证号长度不对，或者号码不符合规定！15位号码应全为数字，18位号码末位可以为数字或x,X'

									},

									{
										xtype : 'label',
										cls : "x-form-field",
										style : "margin-top:4px;margin-left:15px",
										text : '请选择法人身份证复印件:',
										width : 136

									}, {
										xtype : 'fileuploadfield',
										emptyText : '请选择法人身份证复印件...',
										name : 'contactorIdentityFile',
										width : 320,
										style : "margin-left:6px",
										height : 30,
										buttonText : '',
										allowBlank : false,
										blankText : "法人身份证复印件不允许为空",
										buttonCfg : {
											iconCls : 'icon-photo'
										},
										listeners : {
											'fileselected' : function(fb, v) {
												var rootElement = chooseCompanyCertifyForm
														.getForm().reader.jsonData.root;

												choosePicture(
														'contactorIdentityFile',
														v,
														rootElement.contactorIdPath);

											}
										}
									}]
						},

						{
							xtype : 'radiogroup',
							fieldLabel : '公司类型',
							allowBlank : false,
							height : 25,
							width : 600,
							blankText : "必须选择一种公司类型",
							style : "color:#FF8C00;",
							name : 'requestCompanyType',
							items : [{
										boxLabel : "汽修厂/4S店",
										name : "requestCompanyType",
										inputValue : 2,
										checked : true
									}, {
										boxLabel : "经销商",
										name : "requestCompanyType",
										inputValue : 3
									}, {
										boxLabel : "大宗贸易商",
										name : "requestCompanyType",
										inputValue : 4
									}, {
										boxLabel : "汽车配件厂",
										name : "requestCompanyType",
										inputValue : 5
									}, {
										boxLabel : "保险公司",
										name : "requestCompanyType",
										inputValue : 6
									}]
						}, isVisblePanel, {
							name : 'business',
							fieldLabel : '经营项目',
							xtype : 'textarea',
							preventScrollbars : true,
							anchor : '95%'
						}]

			});

			chooseCompanyCertifyForm = new Ext.form.FormPanel({
						labelAlign : 'right',
						frame : true,
						fileUpload : true,
						labelWidth : 100,
						loadingText : '加载数据中...',
						reader : formReader,
						defaults : {},
						buttonAlign : 'center',
						url : '',
						items : [{
									xtype : "hidden",
									fieldLable : "表单ID",
									readOnly : true,
									name : "id"
								},{
									xtype : 'radiogroup',
									height : 20,
									style : "color:#FF8C00;",
									fieldLabel : '公司认证类型',
									blankText : "必须选择一种公司认证类型",
									allowBlank : false,
									BlankText : "必须选择一种公司认证类型",
									name : 'requestRealType',
									items : [{
												boxLabel : "个人认证",
												name : "requestRealType",
												inputValue : 1,
												checked : true
											}, {
												boxLabel : "公司认证",
												name : "requestRealType",
												inputValue : 2
											}]
								}, middlePanel, {
									style : "height:45px"
								},{
									xtype : 'hidden',fieldLabel :'areaId',readOnly:true,name:'areaId'
								}]
					});

			function readOnly(form) {
                //var maskTopField = new Ext.LoadMaskJUPIT(form.findField("requestCompanyType").id);
				chooseCompanyCertify_prov_cmb.setDisabled(true);
				chooseCompanyCertify_city_cmb.setDisabled(true);
				chooseCompanyCertify_dist_cmb.setDisabled(true);
				form.findField("name").setReadOnly(true);
				form.findField("contactor").setReadOnly(true);
				form.findField("business").setReadOnly(true);
				form.findField("contactorIdentityCode").setReadOnly(true);
				form.findField("taxCode").setReadOnly(true);
				form.findField("code").setReadOnly(true);
				form.findField("requestCompanyType").setDisabled(true);
				//maskTopField.show();
				form.findField("contactorIdentityFile").setDisabled(true);
				form.findField("taxCertificationFile").setDisabled(true);
				form.findField("businessLicenseFile").setDisabled(true);
			}

			// 回显认证信息
			chooseCompanyCertifyForm.getForm().load({

				url : Uec3.App.Constants.homeUrl
						+ '/company/query_company!querySimpleCompany.do',
				success : function(form, action) {
					var realType = form.reader.jsonData.root.realType;
					var isCertifying = form.reader.jsonData.root.isCertifying;
					if (realType == 0) {
						// 还没有进行认证

						if (isCertifying == 1) {
							// 正在进行认证中

							Ext.MessageBox.alert("提示",
									"正在进行认证中...,我们将在一到两个工作日内通知你认证结果");
							chooseCompanyCertifyForm.items.get(1).disable();
							// chooseCompanyCertifyForm.items.get(2).setDisabled(true);

							readOnly(form);
							buttonAjaxRequest("formalSummit");

						} else {

							buttonAjaxRequest("new");
						}

					} else if (realType == 1) {
						// 已经通过个人认证

						if (isCertifying == 1) {
							// 确定进行公司认证
							Ext.MessageBox.alert("提示",
									"正在进行个人认证中...,我们将在一到两个工作日内通知你认证结果");
							chooseCompanyCertifyForm.items.get(1).disable();
							// chooseCompanyCertifyForm.items.get(2).setDisabled(true);
							readOnly(form);
							buttonAjaxRequest("formalSummit");

						} else {

							Ext.Msg.confirm('提示', '个人认证成功,是否进行公司认证?', function(
											btn) {
										if (btn == 'yes') {

											chooseCompanyCertifyForm
													.getForm()
													.findField("requestRealType")
													.setValue(2);
											          isVisblePanel.show();
											chooseCompanyCertifyForm.items
													.get(1).items.get(0)
													.disable();

											chooseCompanyCertifyForm.getForm()
													.findField("name").setReadOnly(true);

											chooseCompanyCertifyForm.getForm()
													.findField("contactor").setReadOnly(true);	
													
											chooseCompanyCertifyForm.getForm()
													.findField("contactorIdentityCode").setReadOnly(true);			
											
											chooseCompanyCertifyForm.getForm()
													.findField("business").setReadOnly(true);	
											
											chooseCompanyCertify_prov_cmb.setDisabled(true);
											chooseCompanyCertify_city_cmb.setDisabled(true);
											chooseCompanyCertify_dist_cmb.setDisabled(true);
													
													var maskTopField = new Ext.LoadMaskJUPIT(chooseCompanyCertifyForm.getForm().findField("requestCompanyType").id);
											//chooseCompanyCertifyForm.getForm()
											//		.findField("requestCompanyType").setDisabled(true);		
													maskTopField.show();
											
											chooseCompanyCertifyForm.getForm()
													.findField("contactorIdentityFile").setDisabled(true);			
													
											buttonAjaxRequest("new");
										} else {
											readOnly(form);
											chooseCompanyCertifyForm.items
													.get(1).disable();
											buttonAjaxRequest("certifyUnpass");
											// chooseCompanyCertifyForm.items.get(2).setDisabled(true);

										}
									})

						}
					} else if (realType == 2) {

						// 已经通过公司认证
						Ext.MessageBox.alert("提示", "公司认证已经成功,请查看最新服务",
								function() {

								});
						readOnly(form);
						chooseCompanyCertifyForm.items.get(1).disable();
						// chooseCompanyCertifyForm.items.get(2).setDisabled(true);
						buttonAjaxRequest("certifyPass");

					} else {

						if (isCertifying == 1) {
							// 确定进行公司认证
							Ext.MessageBox.alert("提示",
									"正在进行公司认证中...,我们将在一到两个工作日内通知你认证结果");
							chooseCompanyCertifyForm.items.get(1).disable();
							readOnly(form);
							// chooseCompanyCertifyForm.items.get(2).setDisabled(true);
							buttonAjaxRequest("formalSummit");

						} else {
							var requestRealType = form.reader.jsonData.root.requestRealType;
							if (requestRealType == 2) {

								Ext.Msg.confirm('提示', '公司认证失败,是否重新请求认证?',
										function(btn) {
											if (btn == 'yes') {
																							   
											chooseCompanyCertifyForm.items
													.get(1).items.get(0)
													.disable();

											chooseCompanyCertifyForm.getForm()
													.findField("name").setReadOnly(true);

											chooseCompanyCertifyForm.getForm()
													.findField("contactor").setReadOnly(true);	
													
											chooseCompanyCertifyForm.getForm()
													.findField("contactorIdentityCode").setReadOnly(true);			
											
											chooseCompanyCertifyForm.getForm()
													.findField("business").setReadOnly(true);			
													
													var maskTopField = new Ext.LoadMaskJUPIT(chooseCompanyCertifyForm.getForm().findField("requestCompanyType").id);
			
													maskTopField.show();
											
											chooseCompanyCertifyForm.getForm()
													.findField("contactorIdentityFile").setDisabled(true);	
												
												buttonAjaxRequest("new");
											} else {
												businessLicenseFile1.el.dom.style.width = "300px";
												taxCertificationFile.el.dom.style.width = "300px";
												chooseCompanyCertifyForm.items
														.get(1).disable();
												readOnly(form);
												buttonAjaxRequest("certifyUnpass");
												// chooseCompanyCertifyForm.items.get(2).setDisabled(true);

											}
										});

							} else {

								Ext.Msg.confirm('提示', '个人认证失败,是否重新请求认证?',
										function(btn) {
											if (btn == 'yes') {

												chooseCompanyCertifyForm
														.getForm()
														.findField("requestRealType")
														.setValue(1);
												// chooseCompanyCertifyForm.items.get(1).items
												// .get(0).disable();
												buttonAjaxRequest("new");
											} else {
												businessLicenseFile1.el.dom.style.width = "300px";
												taxCertificationFile.el.dom.style.width = "300px";
												chooseCompanyCertifyForm.items
														.get(1).disable();
												readOnly(form);
												buttonAjaxRequest("certifyUnpass");

												// chooseCompanyCertifyForm.items.get(2).setDisabled(true);

											}
										});

							}

						}

					}

				},

				failure : function(form, action) {
					Ext.Msg.alert("Load failed", action.result.failure);
				}

			});

			// 按钮操作方法
			var buttonAjax = new Ext.data.Connection();

			var operation = function(btn) {

				eval(btn.func + "(btn)");
			}

			// 关闭认证单据

			function certifyClose(btn) {

				chooseCompanyCertifyForm.ownerCt.close();

			}

			function allowCheck(requestRealTypeField) {

				// 不存在认证表单

				var rootElement = chooseCompanyCertifyForm.getForm().reader.jsonData.root;

				if (requestRealTypeField.getValue().inputValue == 2) {
					if (rootElement.contactorIdPath) {
						chooseCompanyCertifyForm.getForm()
								.findField("contactorIdentityFile").allowBlank = true;
						if (rootElement.taxCertificationPath) {

							chooseCompanyCertifyForm.getForm()
									.findField("taxCertificationFile").allowBlank = true;
						} else {

							chooseCompanyCertifyForm.getForm()
									.findField("taxCertificationFile").allowBlank = false;
						}

						if (rootElement.businessLicensePath) {
							chooseCompanyCertifyForm.getForm()
									.findField("businessLicenseFile").allowBlank = true;

						} else {

							chooseCompanyCertifyForm.getForm()
									.findField("businessLicenseFile").allowBlank = false;

						}

					}
				} else {

					if (rootElement.contactorIdPath) {
						chooseCompanyCertifyForm.getForm()
								.findField("contactorIdentityFile").allowBlank = true;

					}

					chooseCompanyCertifyForm.getForm()
							.findField("taxCertificationFile").allowBlank = true;
					chooseCompanyCertifyForm.getForm()
							.findField("businessLicenseFile").allowBlank = true;

				}

			}

			// 保存认证单据
			function certifySave(btn) {
				var requestRealTypeField = chooseCompanyCertifyForm.getForm()
						.findField("requestRealType");
				allowCheck(requestRealTypeField);

				if (!chooseCompanyCertifyForm.getForm().isValid()) {

					Ext.Msg.alert("提示", "请按照要求进行正确操作");

					return;

				}

				chooseCompanyCertifyForm.getForm().submit({

					url : Uec3.App.Constants.homeUrl
							+ '/certify/saveCertify.do',
					method : "post",
					waitMsg : '正在保存数据,请稍后...',
					success : function(form, action) {

					}
				});

			}

			// 提交认证单据

			function certifySubmit(btn) {
				var requestRealTypeField = chooseCompanyCertifyForm.getForm()
						.findField("requestRealType");
		    allowCheck(requestRealTypeField);
		    
			if (!chooseCompanyCertifyForm.getForm().isValid()) {

				Ext.Msg.alert("提示", "请按照要求进行正确操作");

				return;

			}
		    
			if (requestRealTypeField.getValue().inputValue == 1) {
					Ext.Msg.confirm('提示', "如果个人认证一旦成功，除了税号和工商注册号,其他公司信息将不能再修改,还继续执行吗?",
							function(button) {
				if (button == 'yes') {
		
				chooseCompanyCertifyForm.getForm().submit({

					url : Uec3.App.Constants.homeUrl
							+ '/certify/submitCertify.do',
					method : "post",
					waitMsg : '正在保存数据...',
					success : function(form, action) {
						chooseCompanyCertifyForm.items.get(1).disable();
						readOnly(form);
						chooseCompanyCertifyForm.getForm().load({
							url : Uec3.App.Constants.homeUrl
									+ '/company/query_company!querySimpleCompany.do',
							success : function(form, action) {

								var requestRealType = form.reader.jsonData.root.requestRealType;
								if (requestRealType == 2) {

									isVisblePanel.show();

								}

								buttonAjaxRequest("formalSummit");
							}
						});

					},
					failure : function(form, action) {

						Ext.Msg.alert("错误", action.result.failure);
					}
				});
								}
							});

				}else{
				
				chooseCompanyCertifyForm.getForm().submit({

					url : Uec3.App.Constants.homeUrl
							+ '/certify/submitCertify.do',
					method : "post",
					waitMsg : '正在保存数据,请稍后...',
					success : function(form, action) {
						chooseCompanyCertifyForm.items.get(1).disable();
						readOnly(form);
						chooseCompanyCertifyForm.getForm().load({
							url : Uec3.App.Constants.homeUrl
									+ '/company/query_company!querySimpleCompany.do',
							success : function(form, action) {

								var requestRealType = form.reader.jsonData.root.requestRealType;
								if (requestRealType == 2) {

									isVisblePanel.show();

								}

								buttonAjaxRequest("formalSummit");
							}
						});

					},
					failure : function(form, action) {

						Ext.Msg.alert("错误", action.result.failure);
					}
				});
					
					
				}
			}

			// 按钮加载
			function buttonAjaxRequest(statusId, fn) {
				buttonAjax.request({
							url : Uec3.App.Constants.homeUrl
									+ '/certify/queryButtonPanel.do',
							params : {
								statusId : statusId
							},
							success : function(response, options) {
								var result = Ext.decode(response.responseText);
								removeButtons(chooseCompanyCertifyForm);
								initButtons(result.buttons, operation,
										chooseCompanyCertifyForm);// 初始按钮
								// chooseCompanyCertifyForm.ownerCt.doLayout();
								businessLicenseFile1.el.dom.style.width = "300px";
								taxCertificationFile.el.dom.style.width = "300px";
								if (Ext.isFunction(fn))
									fn(reslut);
							}

						});
			}

		}

		function chooseCompanyCertifyControlEvent() {
			
			
			chooseCompanyCertify_prov_cmb.on('select', function(combox) {

				chooseCompanyCertifyForm.getForm().findField('areaId')
						.setValue(combox.getValue());

			});

			chooseCompanyCertify_city_cmb.on('select', function(combox) {

				chooseCompanyCertifyForm.getForm().findField('areaId')
						.setValue(combox.getValue());

			});

	     chooseCompanyCertify_dist_cmb.on('select', function(combox) {
	    
	    	 chooseCompanyCertifyForm.getForm().findField('areaId')
						.setValue(combox.getValue());

			});
			

			chooseCompanyCertifyForm.getForm().on("actioncomplete",
					function(form, action) {
				
		var rootFirstValue=form.reader.jsonData.root;		
		chooseCompanyCertify_prov_cmb
				.setRawValue(rootFirstValue.province);
		chooseCompanyCertify_city_cmb
				.setRawValue(rootFirstValue.city);
		chooseCompanyCertify_dist_cmb
				.setRawValue(rootFirstValue.district);

		if (rootFirstValue.province!= "") {

			chooseCompanyCertify_city_cmb
					.getStore()
					.setBaseParam(
							"prov",
							rootFirstValue.provinceId);
			chooseCompanyCertify_city_cmb.getStore().load();

		}

		if (rootFirstValue.city!= "") {

			chooseCompanyCertify_dist_cmb.getStore().setBaseParam("city",
					rootFirstValue.cityId);
			chooseCompanyCertify_dist_cmb.getStore().load();

		}
				
				

						var rootElement = form.reader.jsonData.root;

						var rt = rootElement.requestRealType;

						if (rt == 2) {
							businessLicenseFile1.el.dom.style.width = "300px";
							taxCertificationFile.el.dom.style.width = "300px";
							chooseCompanyCertifyForm.ownerCt.setHeight(450);

						} else {

							isVisblePanel.hide();
							chooseCompanyCertifyForm.ownerCt.setHeight(350);

						}
					})
					
			chooseCompanyCertifyForm.getForm().findField("requestRealType").on(
					"change", function(radioGroup, radio) {
                          
						if (radio.getRawValue() == 2) {

							chooseCompanyCertifyForm.ownerCt.setHeight(450);
          
							isVisblePanel.show();
							
							chooseCompanyCertifyForm.getForm()
									.findField("businessLicenseFile")
									.setWidth(332);
							chooseCompanyCertifyForm.getForm()
									.findField("taxCertificationFile")
									.setWidth(332);
						} else {
							isVisblePanel.hide();
							chooseCompanyCertifyForm.ownerCt.setHeight(350);

						}
					})

		}

		componentChooseCompanyCertifyInits();

		chooseCompanyCertifyControlEvent();

		return chooseCompanyCertifyForm;
	},

	/**
	 * Create this modules window here.
	 */
	createWindow : function(params) {
		var desktop = Uec3.App.getDesktop();
		var win = desktop.getWindow('chooseCompanyCertify');
		if (!win) {
			win = desktop.createWindow({
						id : 'chooseCompanyCertify',
						title : '公司认证',
						width : 850,
						height : 350,
						iconCls : 'acc-icon',
						shim : false,
						animCollapse : false,
						constrainHeader : true,
						maximizable : false,
						resizable : false,
						taskbuttonTooltip : "公司认证",
						layout : "fit",
						tools : [{
									id : 'refresh',
									handler : Ext.emptyFn,
									scope : this
								}],
						items : [this.getComponents(params)]
					});

		}
		win.show();

	}
});